package com.ynsj.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ynsj.mapper.UserWalletMapper;
import com.ynsj.domain.UserWallet;
import com.ynsj.service.UserWalletService;
@Service
public class UserWalletServiceImpl extends ServiceImpl<UserWalletMapper, UserWallet> implements UserWalletService{

    /**
     * 分页查询会员提币地址
     *
     * @param page
     * @param userId
     * @return
     */
    @Override
    public Page<UserWallet> findWalletByPage(Page<UserWallet> page, Long userId) {
        page.addOrder(OrderItem.desc("last_update_time"));
        return page(page,new LambdaQueryWrapper<UserWallet>().eq(userId!=null,UserWallet::getUserId,userId));
    }
}
